{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": [],
      "gpuType": "T4",
      "authorship_tag": "ABX9TyPLyFy23+c4hfWSUnZ7mRjH",
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/MShahabSepehri/CryptoMamba/blob/main/example.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "cellView": "form",
        "id": "WCqI8zrlp99U",
        "outputId": "a153aa54-dd9e-42a9-ecc5-277bc19282ef"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Cloning into 'CryptoMamba'...\n",
            "remote: Enumerating objects: 101, done.\u001b[K\n",
            "remote: Counting objects: 100% (101/101), done.\u001b[K\n",
            "remote: Compressing objects: 100% (69/69), done.\u001b[K\n",
            "remote: Total 101 (delta 37), reused 90 (delta 30), pack-reused 0 (from 0)\u001b[K\n",
            "Receiving objects: 100% (101/101), 1.35 MiB | 15.39 MiB/s, done.\n",
            "Resolving deltas: 100% (37/37), done.\n"
          ]
        }
      ],
      "source": [
        "# @title Cloning\n",
        "!git clone https://github.com/MShahabSepehri/CryptoMamba.git\n",
        "%cd CryptoMamba/"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# @title Installing requirements\n",
        "\n",
        "%%capture\n",
        "!pip install mamba-ssm[causal-conv1d]\n",
        "!pip install -r requirements.txt"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "cellView": "form",
        "id": "QoSiNMCtqGj5",
        "outputId": "3705f359-fd54-4a20-f7e4-0fc3868ab73b"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "/content/CryptoMamba\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# @title Prediction\n",
        "!python scripts/one_day_pred.py --config cmamba_v --ckpt_path ./checkpoints/cmamba_v.ckpt --date 2024-12-15"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "lAU_41CEeho4",
        "outputId": "ae8ad2be-5f1a-48b6-f50c-4054a0fb1812"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "['Timestamp', 'Open', 'High', 'Low', 'Close', 'Volume']\n",
            "['Timestamp', 'Open', 'High', 'Low', 'Close', 'Volume']\n",
            "['Timestamp', 'Open', 'High', 'Low', 'Close', 'Volume']\n",
            "\n",
            "Prediction date: 2024-12-15\n",
            "Prediction: 102174.26\n",
            "Today value: 101372.97\n",
            "Smart trade: 39.21% buy\n",
            "Vanilla trade: -\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# @title Training\n",
        "!python scripts/training.py --config cmamba_v"
      ],
      "metadata": {
        "id": "fVSOA2b_ssQq"
      },
      "execution_count": null,
      "outputs": []
    }
  ]
}